#include <iostream>
#include <vector>

using namespace std;
class Solution
{
public:
    int countBalls(int lowLimit, int highLimit)
    {
        int box[46] = {0}, ans = 0;
        auto getBits = [](int n) -> int
        {
            int ans = n % 10;
            while (n /= 10)
                ans += n % 10;
            return ans;
        };
        while (lowLimit <= highLimit)
            ans = max(++box[getBits(lowLimit++)], ans);
        return ans;
    }
};
int main()
{
    Solution s;
    cout << s.countBalls(1, 20) << endl;
    return 0;
}